package cn.tedu.egcar1.controller;

import cn.tedu.egcar1.base.response.JsonResult;
import cn.tedu.egcar1.mapper.NoticeMapper;
import cn.tedu.egcar1.pojo.vo.NoticeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "公告管理系统")
@RestController
@RequestMapping("/v1/notice/")
public class NoticeController {
    @Autowired
    private NoticeMapper noticeMapper;
    @ApiOperation(value="首页公告列表")
    @GetMapping("list")
    public JsonResult list(){
        List<NoticeVO> list = noticeMapper.selectListNotice();
        return JsonResult.ok(list);

    }
}
